package com.songyang.blog.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.songyang.blog.entity.UserMessage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 宋阳
 * @since 2021-05-07
 */
@Component
public interface UserMessageMapper extends BaseMapper<UserMessage> {

    IPage selectMessage(Page page, @Param(Constants.WRAPPER) QueryWrapper<UserMessage> wrapper);

    @Update("update user_message set status=1  ${ew.customSqlSegment}")
    void updateToReaded(@Param(Constants.WRAPPER) QueryWrapper<UserMessage> id);
}
